<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>DECLARE_INHERITED_CLASS</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="internals2.opcodes.declare-function.html">DECLARE_FUNCTION</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="internals2.opcodes.declare-inherited-class-delayed.html">DECLARE_INHERITED_CLASS_DELAYED</a></div>
 <div class="up"><a href="internals2.opcodes.list.html">Opcode Descriptions and Examples</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="internals2.opcodes.declare-inherited-class" class="section">
 <h2 class="title">DECLARE_INHERITED_CLASS</h2>
 <div class="section" id="internals2.opcodes.declare-inherited-class.code">
  <h2 class="title">PHP code</h2>
  <div class="example-contents">
   <div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /></span><span style="color: #FF8000">/*<br />&nbsp;*&nbsp;<br />&nbsp;*&nbsp;opcode&nbsp;number:&nbsp;140<br />&nbsp;*/<br />&nbsp;</span><span style="color: #007700">if(</span><span style="color: #0000BB">$b</span><span style="color: #007700">){<br />&nbsp;class&nbsp;</span><span style="color: #0000BB">Foo&nbsp;</span><span style="color: #007700">{<br />&nbsp;&nbsp;public&nbsp;static&nbsp;</span><span style="color: #0000BB">$my_static&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">'foo'</span><span style="color: #007700">;<br />&nbsp;&nbsp;public&nbsp;function&nbsp;</span><span style="color: #0000BB">staticValue</span><span style="color: #007700">()&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;</span><span style="color: #0000BB">self</span><span style="color: #007700">::</span><span style="color: #0000BB">$my_static</span><span style="color: #007700">;<br />&nbsp;&nbsp;}<br />&nbsp;}<br /><br />&nbsp;class&nbsp;</span><span style="color: #0000BB">Bar&nbsp;</span><span style="color: #007700">extends&nbsp;</span><span style="color: #0000BB">Foo&nbsp;</span><span style="color: #007700">{<br />&nbsp;&nbsp;public&nbsp;function&nbsp;</span><span style="color: #0000BB">fooStatic</span><span style="color: #007700">()&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #0000BB">parent</span><span style="color: #007700">::</span><span style="color: #0000BB">$my_static</span><span style="color: #007700">;<br />&nbsp;&nbsp;}<br />&nbsp;}<br />}<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
  </div>

 </div>
 <div class="section" id="internals2.opcodes.declare-inherited-class.listing">
  <h2 class="title">PHP opcodes</h2>
  <p class="simpara">Function name: (null)</p>
  <p class="simpara">Compiled variables: !0=$b </p>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>line</th><th>#</th><th>op</th>
      <th>fetch</th><th>ext</th><th>return</th>
      <th>operands</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td>6</td><td>0</td>
      <td>JMPZ</td><td class="empty">&nbsp;</td>
      <td class="empty">&nbsp;</td><td class="empty">&nbsp;</td>
      <td>!0,-&gt;5</td>
     </tr>

     <tr>
      <td>7</td><td>1</td>
      <td>ZEND_DECLARE_CLASS</td><td class="empty">&nbsp;</td>
      <td class="empty">&nbsp;</td><td>$0</td>
      <td>&#039;%00foo%2Fmnt%2Fworkspace%2Fws_phpscripts%2FPHPopcodes%2Fphpsamples%2FDECLARE_INHERITED_CLASS.php0xb7be503b&#039;,&#039;foo&#039;</td>
     </tr>

     <tr>
      <td>14</td><td>2</td>
      <td>ZEND_FETCH_CLASS</td><td class="empty">&nbsp;</td>
      <td class="empty">&nbsp;</td><td>:1</td>
      <td>&#039;Foo&#039;</td>
     </tr>

     <tr>
      <td class="empty">&nbsp;</td><td>3</td>
      <td>ZEND_DECLARE_INHERITED_CLASS</td><td class="empty">&nbsp;</td>
      <td class="empty">&nbsp;</td><td>$2</td>
      <td>&#039;%00bar%2Fmnt%2Fworkspace%2Fws_phpscripts%2FPHPopcodes%2Fphpsamples%2FDECLARE_INHERITED_CLASS.php0xb7be50bc&#039;,&#039;bar&#039;</td>
     </tr>

     <tr>
      <td>19</td><td>4</td>
      <td>JMP</td><td class="empty">&nbsp;</td>
      <td class="empty">&nbsp;</td><td class="empty">&nbsp;</td>
      <td>-&gt;5</td>
     </tr>

     <tr>
      <td>20</td><td>5</td>
      <td>RETURN</td><td class="empty">&nbsp;</td>
      <td class="empty">&nbsp;</td><td class="empty">&nbsp;</td>
      <td>1</td>
     </tr>

    </tbody>
   
  </table>

  <p class="simpara">Function name: staticValue</p>
  <p class="simpara">Compiled variables: !0=$my_static </p>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>line</th><th>#</th><th>op</th>
      <th>fetch</th><th>ext</th><th>return</th>
      <th>operands</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td>10</td><td>0</td>
      <td>ZEND_FETCH_CLASS</td><td class="empty">&nbsp;</td>
      <td class="empty">&nbsp;</td><td class="empty">&nbsp;</td>
      <td class="empty">&nbsp;</td>
     </tr>

     <tr>
      <td class="empty">&nbsp;</td><td>1</td>
      <td>FETCH_R</td><td>staticmember</td>
      <td class="empty">&nbsp;</td><td>$1</td>
      <td>&#039;my_static&#039;</td>
     </tr>

     <tr>
      <td class="empty">&nbsp;</td><td>2</td>
      <td>RETURN</td><td class="empty">&nbsp;</td>
      <td class="empty">&nbsp;</td><td class="empty">&nbsp;</td>
      <td>$1</td>
     </tr>

     <tr>
      <td>11</td><td>3</td>
      <td>RETURN</td><td class="empty">&nbsp;</td>
      <td class="empty">&nbsp;</td><td class="empty">&nbsp;</td>
      <td>null</td>
     </tr>

    </tbody>
   
  </table>

  <p class="simpara">Function name: fooStatic</p>
  <p class="simpara">Compiled variables: !0=$my_static </p>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>line</th><th>#</th><th>op</th>
      <th>fetch</th><th>ext</th><th>return</th>
      <th>operands</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td>16</td><td>0</td>
      <td>ZEND_FETCH_CLASS</td><td class="empty">&nbsp;</td>
      <td class="empty">&nbsp;</td><td>:0</td>
      <td class="empty">&nbsp;</td>
     </tr>

     <tr>
      <td class="empty">&nbsp;</td><td>1</td>
      <td>FETCH_R</td><td>staticmember</td>
      <td class="empty">&nbsp;</td><td>$1</td>
      <td>&#039;my_static&#039;</td>
     </tr>

     <tr>
      <td class="empty">&nbsp;</td><td>2</td>
      <td>ECHO</td><td class="empty">&nbsp;</td>
      <td class="empty">&nbsp;</td><td class="empty">&nbsp;</td>
      <td>$1</td>
     </tr>

     <tr>
      <td>17</td><td>3</td>
      <td>RETURN</td><td class="empty">&nbsp;</td>
      <td class="empty">&nbsp;</td><td class="empty">&nbsp;</td>
      <td>null</td>
     </tr>

    </tbody>
   
  </table>

 </div>
</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="internals2.opcodes.declare-function.html">DECLARE_FUNCTION</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="internals2.opcodes.declare-inherited-class-delayed.html">DECLARE_INHERITED_CLASS_DELAYED</a></div>
 <div class="up"><a href="internals2.opcodes.list.html">Opcode Descriptions and Examples</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
